package com.example.splash.font

import android.content.Context
import android.content.Intent
import android.net.Uri
import android.provider.Settings

object FontHelper {


    fun getRequestPermission(context: Context): Intent {
        return Intent(
            Settings.ACTION_MANAGE_WRITE_SETTINGS,
            Uri.parse("package:${context.packageName}")
        )
    }


    fun hasPermission(context: Context) =Settings.System.canWrite(context)



    fun setFontSize(context: Context,fontSize:Float){
        Settings.System.putFloat(context.contentResolver, Settings.System.FONT_SCALE, fontSize)
    }



    fun getFontSize(context:Context) = Settings.System.getFloat(context.contentResolver, Settings.System.FONT_SCALE)

}